<?php

					$masterProductId = extractNumberWithKeyFromArray("masterProductId", $_GET);

					if($masterProductId)
						$cmsDocument->addConstraint("categorycode", $masterProductId);
					$cmsDocument->resetIterator();
?>
			<table width="100%" class="cms_browsetext"  border="0" cellspacing="0" cellpadding="0">
			  <tr>
				<td colspan="6"> 
				<form action="/cms/html/index.php?fileNo=222&masterProductId=<?=$masterProductId?>" method="post" style="float:right">
				<input type="submit" value="Muptiple Upload" />
				</form>
				
				
				</td>
			  </tr>
			  <tr > 
				<th align="left" width="45"><a href="/cms/html/index.php?sorts=documentcode&direction=<?= ($direction == "DESC") ? "ASC" : "DESC" ?>">Id</a></th>
				<th align="left" width="70"><a href="/cms/html/index.php?sorts=datelogged&direction=<?= ($direction == "DESC") ? "ASC" : "DESC" ?>">Entered</a></th>
				<th align="left" ><a href="/cms/html/index.php?sorts=title&direction=<?= ($direction == "DESC") ? "ASC" : "DESC" ?>">Title</a></th>
				<th align="left" width="155"><a href="/cms/html/index.php?sorts=categorycode&direction=<?= ($direction == "DESC") ? "ASC" : "DESC" ?>">Master Product</a></th>				
				<th align="left" width="15">&nbsp;</th>
				<th align="left" width="75">Action</th>
				<th align="left" width="1"></th>
			  </tr>
<?php

	$MasterProductCmsDocument = new CmsDocument($db);
	while(($row = $cmsDocument->nextDocument())){
		
		$masterProduct = $MasterProductCmsDocument->openDocument($row->categorycode);
?>
				<tr> 
				<td colspan="6" align="left"> 
<img height="7" src="/cms/images/greyline.gif"  width="100%" />

				</td>
			  </tr>
			  
			  <tr> 
				<td width="45" class="cms_browsetext"> 
				  <?= $row->documentcode ?>
				</td>
				<td width="70" class="cms_browsetext"> 
				  <?= dateFromString("d-m-y",$row->datelogged) ?>
				</td>
				<td  class="cms_browsetext"> 
				  <?= magicClean($row->title) ?>
				</td>
				<td  class="cms_browsetext"> 
				  <?= magicClean($masterProduct->title) ?>
				</td>				
				<td width="15">
<?
				$activeImage = $row->active == '1' ? 'active' : 'inactive';
				print <<< EOD
					  <img src="/cms/images/cnt_$activeImage.gif" width="10" height="10">
EOD;
?>
				</td>
				<td width="75" class="cms_browsetext">
<?
					if(editFormAuth($authInfo, $formDescription, $row->documentcode, $db)) { 
?>
<a href="/cms/html/index.php?fileNo=2&documentCode=<? print($row->documentcode); ?>" >Edit</a> 
<?
					}
					if(deleteFormAuth($authInfo, $formDescription, $row->documentcode, $db)) {
?>
 / <a href="/cms/html/index.php?fileNo=4&documentCode=<? print($row->documentcode); ?>&returnURLEncoded=<?= urlencode($returnURL) ?>&cancelURLEncoded=<?= urlencode($cancelURL) ?>" >Delete</a>
<?
					}
?> 
				</td>
				<td><img src="/cms/images/spacer.gif" width="1" height="20" /></td>
				</tr>
<?
	}

?>				<tr> 
				<td colspan="6" align="left"> 
<img height="7" src="/cms/images/greyline.gif"  width="100%" />
				</td>
			  </tr>
			</table>	

		
	  
